/**
 * Created with IntelliJ IEDA.
 * Description:
 * User:86186
 * Date:2022-10-07
 * Time:14:53
 */

/**
 * 力扣1800:z最大升序子数组和
 */

public class maxAscendingSum {
    public int maxAscendingSum(int[] nums) {
        int end = 0;
        int oneend = 0;
        oneend += nums[0];
        for(int i = 1;i < nums.length;i++){
            if(nums[i] > nums[i - 1]){
                oneend += nums[i];
            }else{
                end = Math.max(end,oneend);
                oneend = 0;
                oneend += nums[i];
            }
        }

        return Math.max(end,oneend);
    }
}




